package com.itheima03.day11;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

/**
 * @author 刘全
 * @date 2021/7/31
 */
public class Test01 {
    public static void main(String[] args) throws IOException {
        File file = new File("myideaTest\\aaa\\a.txt");
        if (!file.exists()) {
            file.createNewFile();
        } else {
            System.out.println("是否要删除该文件?");
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            if ("是".equals(s)) {
                file.delete();
            } else if ("否".equals(s)) {

            } else {
                System.out.println("您的输入有误!");
            }
        }
    }
}
